package com.yizhang.xml.handlers;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;

public class YiZhangBeanDefinitionParser implements BeanDefinitionParser {
    @Override
    public BeanDefinition parse(Element element, ParserContext parserContext) {
        BeanDefinition definition = new RootBeanDefinition();
        definition.setBeanClassName("com.yizhang.xml.processor.YiZhangBeanPostProcessor");
        parserContext.getRegistry().registerBeanDefinition("YiZhangBeanPostProcessor", definition);
        return definition;
    }
}
